unit CustomerForm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Mask, DBCtrls, Grids, DBGrids, ExtCtrls,DefaultForm;

type
  TForm2 = class(TForm5)
    DBEdit2: TDBEdit;
    DBEdit3: TDBEdit;
    DBEdit4: TDBEdit;
    DBEdit5: TDBEdit;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    DBNavigator1: TDBNavigator;
    Panel1: TPanel;
    DBGrid1: TDBGrid;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Clear();
    procedure DBEdit4KeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

uses DataModule;

{$R *.dfm}

procedure TForm2.Clear;
begin
    DataModule2.CustomersTable.Insert;
end;

procedure TForm2.DBEdit4KeyPress(Sender: TObject; var Key: Char);
begin
    if not((key>='0') and (key<='9')or(key=#8)) then
        key:=char(0)
end;

procedure TForm2.Button1Click(Sender: TObject);
begin
    Datamodule2.CustomersTable.Post;
    Clear;
end;

procedure TForm2.Button2Click(Sender: TObject);
begin
    Close;
end;

end.
